package ru.sstu.renju.core;

/**
 * <code>GameResult</code> class contains game result.
 *
 * @author denis_murashev
 * @since Renju 1.0
 */
public class GameResult {

	private Winner winner;
	private Row winnigRow;

	/**
	 * @return the winner
	 */
	public Winner getWinner() {
		return winner;
	}

	/**
	 * @param winner the winner to set
	 */
	public void setWinner(Winner winner) {
		this.winner = winner;
	}

	/**
	 * @return the winnigRow
	 */
	public Row getWinnigRow() {
		return winnigRow;
	}

	/**
	 * @param winnigRow the winnigRow to set
	 */
	public void setWinnigRow(Row winnigRow) {
		this.winnigRow = winnigRow;
	}

	/**
	 * <code>Winner</code> enumeration represents possible game winners.
	 *
	 * @author denis_murashev
	 * @since Renju 1.0
	 */
	public static enum Winner {

		/**
		 * The winner is first (Black) player.
		 */
		BLACK("result.black.wins"),

		/**
		 * There is no winner. Draw.
		 */
		DRAW("result.draw"),

		/**
		 * The winner is second (White) player.
		 */
		WHITE("result.white.wins");

		private final String text;

		/**
		 * @param text text
		 */
		private Winner(String text) {
			this.text = text;
		}

		/**
		 * @return the text
		 */
		public String getText() {
			return text;
		}
	}
}
